import 'package:kxy_flutter_app/model/exam.dart';

import 'course.dart';

class BreakRuleProfile {
  String id;
  String reason;
  String breakRuleTime;
  String breakRule;

  BreakRuleProfile({this.id, this.reason, this.breakRuleTime, this.breakRule});

  static BreakRuleProfile fromJson(Map<String, dynamic> json) {
    return BreakRuleProfile(
      id: json['id'],
      reason: json['reason'],
      breakRuleTime: json['breakRuleTime'],
      breakRule: json['breakRule'],
    );
  }
}

class BreakRule {
  String id;
  String reason;
  String breakRuleTime;
  String breakRule;
  String punishResult;
  String punishNoticeUrl;
  String punishLevel;
  String trainNoticeUrl;
  String remorseLetterUrl;
  List<CourseProfile> courseList;
  List<Exam> examList;

  BreakRule({
    this.id,
    this.reason,
    this.breakRuleTime,
    this.breakRule,
    this.punishResult,
    this.punishNoticeUrl,
    this.punishLevel,
    this.trainNoticeUrl,
    this.remorseLetterUrl,
    this.courseList,
    this.examList,
  });

  static BreakRule fromJson(Map<String, dynamic> json) {
    return BreakRule(
      id: json['id'],
      reason: json['reason'],
      breakRuleTime: json['breakRuleTime'],
      breakRule: json['breakRule'],
      punishResult: json['punishResult'],
      punishNoticeUrl: json['punishNoticeUrl'],
      punishLevel: json['punishLevel'],
      trainNoticeUrl: json['trainNoticeUrl'],
      remorseLetterUrl: json['remorseLetterUrl'],
      courseList: (json['breakRuleCourseList'] as List).map((e) => CourseProfile.fromJson(e)).toList(),
      examList: (json['breakRuleExamList'] as List).map((e) => Exam.fromJson(e)).toList(),
    );
  }
}